﻿var weiboContent;
var weibosharefn = (function () {
    var _w = 16, _h = 16;
    var fn = function (options) {
        var param = {
            url: location.href,
            type: '3',
            count: '', /**是否显示分享数，1显示(可选)*/
            appkey: '2254065920', /**您申请的应用appkey,显示分享来源(可选)*/
            title: '', /**分享的文字内容(可选，默认为所在页面的title)*/
            pic: '', /**分享图片的路径(可选)*/
            ralateUid: '1721449743', /**关联用户的UID，分享微博会@该用户(可选)*/
            language: 'zh_cn', /**设置语言，zh_cn|zh_tw(可选)*/
            rnd: new Date().valueOf()
        }
        param = $.extend(param, options);
        var temp = [];
        for (var p in param) {
            temp.push(p + '=' + encodeURIComponent(param[p] || ''))
        }
        return "http://hits.sinajs.cn/A1/weiboshare.html?" + temp.join("&");
    };
    var src = fn({ title: weiboContent + ' !', /**分享的文字内容(可选，默认为所在页面的title)*/
        pic: ''/**分享图片的路径(可选)*/
    });

    var id = "";
    document.write('<iframe ' + (id ? 'id="' + id + '"' : '') + ' allowTransparency="true" frameborder="0" scrolling="no" src="' + src + '" width="' + _w + '" height="' + _h + '"></iframe>')
    return fn;
})();
